<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
$strSQL = "select * from `bet_Lotto` where ID = ".(int)$_data["ID"];
if(!$RS = @PMA_mysql_query($strSQL, $$_Conn)){
	$GLOBALS["errormessage"] = "Find Lotto Data Error!!";
	ErrMsgOutputHTML("Error", "", 1);
}

if(PMA_mysql_num_rows($RS) == 0){
	@mysql_close($$_Conn);
	header("Location: ".basename($_SERVER["PHP_SELF"])."?op=List");
	exit();
}else{
	$objLotto = PMA_mysql_fetch_object($RS);
}


//找出  Lotto 的單場、單注限額，傳回陣列
$arrELimits = FindLottoLimits($_data["ID"]);
if($arrELimits === false)ErrMsgOutputHTML("Error", "", 1);

$strELimit = TableLottoLimits($arrELimits, 0, $arrLimitBT[$objLotto -> LType][0], $arrLimitBT[$objLotto -> LType][1], $objLotto -> LType);
$strBLimit = TableLottoLimits($arrELimits, 1, $arrLimitBT[$objLotto -> LType][0], $arrLimitBT[$objLotto -> LType][1], $objLotto -> LType);
$strCLimit = CheckGambleLimits($_strLotto["EventLimit"], $_strLotto["BetLimit"], $objLotto -> LType);

$fp = @file($strTemplatePath."Limit.html");
$fp = implode("", $fp);
$fp = setHTMLCharset($fp);

$fp = str_replace("{intID}", $objLotto -> ID, $fp);
$strLo = "Lotto_".$_intLang;
$fp = str_replace("{ShowLotto}", $objLotto -> $strLo, $fp);

while(list($k, $v) = each($_strLotto)){
	$fp = str_replace("{".$k."}", $v, $fp);
}

$fp = str_replace("{ShowEventLimit}", $strELimit, $fp);
$fp = str_replace("{ShowBetLimit}", $strBLimit, $fp);
$fp = str_replace("{CheckGambleLimits}", $strCLimit, $fp);

//輸出
WebOutputHTML($fp, 1);
?>